<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->

    <title>超级管理员系统界面</title>


    <!-- Bootstrap -->
    <link href="/webjars/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">

    <!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery，所以必须放在前边) -->
    <script src="/webjars/jquery/3.5.1/jquery.min.js"></script>
    <!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"></script>

    <!--    点击按钮弹出修改表单-->
    <script th:inline="none">$('#myModal1').modal(show);
    </script>

</head>
<body>

<!--引入导航条-->
<div th:replace="~{adminPages/index::nav}"></div>


<!--表格-->
<table class="table table-hover">
    <thead>
    <th>系名</th>
    <th>操作</th>

    </thead>

    <tr th:if="${department.department_id} ne 0" th:each="department:${departmentList}">
        <td th:text="${department.department_name}"></td>
        <td><form th:method="post" th:action="@{'/department/delete/'+${department.department_id}}">
                <input type="hidden" name="_method" value="delete"/>
                <input type="submit" value="删除"/>
            </form>
        </td>


    </tr>


</table>

<hr/>

<p>
    <button type="button" class="btn btn-primary btn-xs"  data-toggle="modal" data-target="#myModal1">添加系</button>
</p>


<!--添加系的弹出框 -->
  <div class="modal fade" id="myModal1">
                  <div class="modal-dialog">
                  <div class="modal-content">
                  <div class="modal-header">
                  <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                  <h4 class="modal-title">添加系</h4>
                  </div>
                  <div class="modal-body">

                    <form class="form-horizontal" th:method="post" th:action="@{/department/add}">
                        <div class="form-group">
                            <label for="inputdepartmentname" class="col-sm-2 control-label">系名</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" id="inputdepartmentname" th:name="department_name" th:placeholder="要添加的系名">
                            </div>
                        </div>

                        <div class="form-group">
                            <div class="col-sm-offset-2 col-sm-10">
                                <button type="submit" class="btn btn-default">添加</button>
                            </div>
                        </div>

                    </form>

                  </div>
                  </div>
                  </div>
      </div>

</body>
</html>